
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
 */
package com.primecodegen.common.bean;

//~--- non-JDK imports --------------------------------------------------------


import java.util.logging.Level;
import java.util.logging.Logger;
import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.component.submenu.Submenu;
import org.primefaces.model.DefaultMenuModel;
import org.primefaces.model.MenuModel;

//~--- JDK imports ------------------------------------------------------------

import javax.faces.bean.ManagedBean;

@ManagedBean(name="myMenuBean")
public class MenuBean {
    private MenuModel model;
    private Submenu submenu;
    private MenuItem item;

    public MenuBean() {
        try {
            model = new DefaultMenuModel();
            
          
            

            
            submenu = new Submenu();
            submenu.setLabel("Data Model");

            item = new MenuItem();
            item.setValue("Project");
            item.setUrl("/faces/Services/DataModelProject/DataModelProject.xhtml");

            submenu.getChildren().add(item);
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Object");
            item.setUrl("/faces/Services/DataModelObject/DataModelObject.xhtml");
            submenu.getChildren().add(item);
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Attribute");
            item.setUrl("/faces/Services/DataModelAttributes/DataModelAttributes.xhtml");
            submenu.getChildren().add(item);
            model.addSubmenu(submenu);
            
            //##########################################################
            //##########################################################
            
            submenu = new Submenu();
            submenu.setLabel("Configure Rules");

            item = new MenuItem();
            item.setValue("Project Properties");
            item.setUrl("/faces/Services/ProjectProperties/ProjectProperties.xhtml");

            submenu.getChildren().add(item);
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Object Properties");
            item.setUrl("/faces/Services/ObjectProperties/ObjectProperties.xhtml");
            submenu.getChildren().add(item);
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Attributes Properties");
            item.setUrl("/faces/Services/AttributesProperties/AttributesProperties.xhtml");
            submenu.getChildren().add(item);
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Main Project");
            item.setUrl("/faces/Services/MainProject/MainProject.xhtml");
            submenu.getChildren().add(item);
            
            //---------------------------<<<Create Project>>>------------------------------
            item = new MenuItem();
            item.setValue("Generate Wizard");
            item.setUrl("/faces/Services/GenerateWizard.xhtml");
            submenu.getChildren().add(item);
            
            model.addSubmenu(submenu);
        } catch (Exception ex) {
            Logger.getLogger(MenuBean.class.getName()).log(Level.SEVERE, null, ex);
        }
  
        
    }

    public MenuModel getModel() {
        return model;
    }
//    public boolean itemHasParent() {
//        menuDao.get
//    }
}

